package com.salt.database.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

import java.io.Serializable;

/**
 * 全局配置类
 * @author salt
 * @version 2017-06-25
 */
@Lazy(false)
@Configuration
public class DsProperites implements Serializable {

	private static final long serialVersionUID = 1L;

	private static Logger logger = LoggerFactory.getLogger(DsProperites.class);


	@Value("${demoMode}")
	private String demoMode;

	@Value("${plugin.Page}")
	private String Page;

	@Value("${plugin.Area")
	private String Area;

	@Value("${plugin.Office}")
	private String Office;

	@Value("${plugin.User}")
	private String User;
	@Value("${plugin.UserUtils}")
	private String UserUtils;

	public static DsProperites getInstance(){

		return DsSpringContextHolder.getBean(DsProperites.class);
	}

	/**
	 * 是否是演示模式，演示模式下不能修改用户、角色、密码、菜单、授权
	 */
	public  Boolean isDemoMode() {
		String dm = this.demoMode;
		return "true".equals(dm) || "1".equals(dm);
	}

	public void setDemoMode(String demoMode) {
		this.demoMode = demoMode;
	}


	public String getPage() {
		return Page;
	}

	public void setPage(String page) {
		Page = page;
	}

	public String getArea() {
		return Area;
	}

	public void setArea(String area) {
		Area = area;
	}

	public String getOffice() {
		return Office;
	}

	public void setOffice(String office) {
		Office = office;
	}

	public String getUser() {
		return User;
	}

	public void setUser(String user) {
		User = user;
	}


	public String getUserUtils() {
		return UserUtils;
	}

	public void setUserUtils(String userUtils) {
		UserUtils = userUtils;
	}

}
